/**
 * 
 */
package com.swfee.qinben.util;

/**
 * @author ddr
 * 
 */
public class StringUtils {

	public static boolean isEmpty(String str) {
		return str == null || str.trim().length() == 0;
	}

	public static boolean isNumber(String str) {
		try {
			if (!isEmpty(str)) {
				Double.parseDouble(str);
				return true;
			}
			return false;
		} catch (Exception e) {
			return false;
		}
	}

	
	public static String firstLower(String str){
		if(isEmpty(str)){
			return str;
		}
		String first = str.charAt(0)+"";
		
		if(first.toLowerCase().equals(first)){
			return str;
		}else{
			return first.toLowerCase()+str.substring(1);
		}
	}
	public static String firstUpper(String str){
		if(isEmpty(str)){
			return str;
		}
		String first = str.charAt(0)+"";
		
		if(first.toUpperCase().equals(first)){
			return str;
		}else{
			return first.toUpperCase()+str.substring(1);
		}
	}
}
